home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr11 / gedvw105.zip / INDENT.PRG < prev    next >
Text File  |  1995-03-05  |  918b  |  59 lines

  1. *
  2. *    This will indent all GEDCOM lines 2 spaces * level, using the
  3. *    argument as the output file.  If there is no argument, it will
  4. *    create NEW.GED.
  5. *
  6. *    for GEDView 1.05
  7. *    michael@genealogy.emcee.com - 3 Mar 1995
  8. *
  9. set bell off
  10. remember record
  11. compare $ARG 
  12. ifequal
  13.     goto set-default-name
  14. set #outfile $ARG
  15. save $OUTFILE ""
  16. go 1
  17.  
  18. :the-top
  19.     show creating $OUTFILE ....
  20.     get line
  21.     iffailed
  22.         goto the-end
  23.  
  24. :do-record
  25.     set #counter -1
  26.     gosub check-level
  27.     append $OUTFILE $LINE
  28.     append $OUTFILE "\J"
  29.     get next line
  30.     ifequal
  31.         goto do-record
  32.     next
  33.     iffailed
  34.         goto the-end
  35.     goto the-top
  36.  
  37. :the-end
  38.     go record
  39.     set bell on
  40.     end
  41.  
  42. :check-level
  43.     add 1 #counter
  44.     ifescape
  45.         goto the-end
  46.     compare $FIELD1 $COUNTER
  47.     iffailed
  48.         goto check-level
  49.     do $COUNTER
  50.         append $OUTFILE "  "
  51.     repeat
  52.     return
  53.  
  54. :set-default-name
  55.     set #outfile new.ged
  56.     save $OUTFILE
  57.     go 1
  58.     goto the-top
  59.